# -*- codeing = utf-8 -*-
# @Time : 2023/2/14 16:00
# @Author : 小马
# @File: Zombie.py
# @Software : PyCharm
import pygame.sprite
import random

class Boss(pygame.sprite.Sprite):
    def __init__(self):
        super(Boss,self).__init__()
        self.image=pygame.image.load('material/b7.1.PNG').convert_alpha()
        self.images=[pygame.image.load('material/b7.{:d}.png'.format(i)).convert_alpha() for i in range(1,34)]
        self.rect = self.images[0].get_rect()
        t = random.randint(1, 5)
        self.rect.top = t * 100

        self.speed = 3
        self.rect.left = 1200
        self.blood=3



    def update(self, *args):
        if self.blood>0:
          self.image=self.images[args[0]%len(self.images)]

          if self.rect.left<600:
            self.kill()
          else:
            self.rect.left -= self.speed
        else:
            self.kill()


